Common Options for Ad-hoc Commands

-i <inventory_file> : Specify a custom inventory file.


ansible all -m ping -i custom_inventory


-b (or --become) : Run commands with elevated privileges (i.e., sudo).


ansible all -m apt -a "name=nginx state=present" -b


-u <user> : Specify a remote user to use for SSH connections.


ansible all -m ping -u ansible_user


--limit <hosts> : Limit the command to a specific host or group.


ansible all -m ping --limit webserver1
Whereisstuff is simple learing platform for beginer to advance level to improve there skills in technologies.we will provide all material free of cost.you can write a code in runkit workspace and we provide some extrac features also, you agree to have read and accepted our terms of use, cookie and privacy policy.
© Copyright 2024 www.whereisstuff.com. All rights reserved. Developed by whereisstuff Tech.